const Mock = require('mockjs')

const data = Mock.mock({
  'items|20': [{
    id: '@id',
    // title: '@sentence(10, 20)',
    // 'status|1': ['published', 'draft', 'deleted'],
    // author: 'name',
    // display_time: '@datetime',
    // pageviews: '@integer(300, 5000)'
    fullName: '@sentence(10, 20)',
    shortName: '@sentence(1, 5)',
    address: '@title(5, 10)',
    'categoryName|1': ['自营', '旗舰店', '官方店'],
    discount: '@integer(300, 5000)',
    pageViews: '@integer(1, 5000)'
  }]
})

module.exports = [
  {
    url: '/vue-admin-template/shop/list',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 200,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  }
]
